package com.yunxi.service.dubboService.impl;

import com.github.pagehelper.PageInfo;
import com.yunxi.model.order.TrRefundAudit;
import com.yunxi.order.pojo.TrRefundAuditVO;
import com.yunxi.order.service.TrRefundAuditDubboService;
import com.yunxi.service.localService.TrRefundAuditService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * <p>
 * 订单退款审核表 服务实现类
 * </p>
 *
 * @author 
 * @since 2019-09-09
 */
public class TrRefundAuditDubboServiceImpl implements TrRefundAuditDubboService {

    @Autowired
    @Qualifier(value = "trRefundAuditServiceImpl")
    TrRefundAuditService trRefundAuditService;


    @Override
    public TrRefundAuditVO getById(String id) throws InvocationTargetException, IllegalAccessException {
    TrRefundAudit trRefundAudit = trRefundAuditService.getById(id);
    TrRefundAuditVO trRefundAuditVO = new TrRefundAuditVO();
        BeanUtils.copyProperties(trRefundAudit,trRefundAuditVO);
        return trRefundAuditVO;
    }

    @Override
    public void saveOrUpdate(TrRefundAuditVO trRefundAuditVO) throws InvocationTargetException, IllegalAccessException {
    TrRefundAudit trRefundAudit = new TrRefundAudit();
        BeanUtils.copyProperties(trRefundAuditVO,trRefundAudit);
    trRefundAuditService.saveOrUpdate(trRefundAudit);
    }

    @Override
    public void removeById(String id) {
    trRefundAuditService.removeById(id);
    }

    @Override
    public PageInfo<TrRefundAuditVO> findPageByVO(TrRefundAuditVO trRefundAuditVO, Integer pageNum, Integer pageSize) throws InvocationTargetException, IllegalAccessException {
      PageInfo<TrRefundAuditVO> pageInfo = trRefundAuditService.pageByVo(trRefundAuditVO,pageNum,pageSize);
      return pageInfo;
   }

    @Override
    public void removeByListVo(List<TrRefundAuditVO> trRefundAuditVOList) throws IllegalAccessException, InvocationTargetException, InstantiationException {
        trRefundAuditService.removeByListVo(trRefundAuditVOList);
    }

    @Override
    public List listByVo(TrRefundAuditVO trRefundAuditVO) {
      return trRefundAuditService.listByVo(trRefundAuditVO);
    }
}
